/**
 * @param {number[]} arr
 * @return {number[][]}
 */
export var minimumAbsDifference = function (arr) {
  arr.sort((a, b) => a - b)
  let minDiff = Number.MAX_VALUE
  let ans = []
  for (let i = 0; i < arr.length - 1; i++) {
    const diff = arr[i + 1] - arr[i]
    if (diff === minDiff) ans.push([arr[i], arr[i + 1]])
    else if (diff < minDiff) {
      minDiff = diff
      ans = [[arr[i], arr[i + 1]]]
    }
  }
  return ans
}
